//
//  RadioRoomViewController.swift
//  FMRadio
//
//  Created by 范东 on 2022/7/26.
//

import UIKit
import FDUIKit
import AVFoundation

class RadioRoomViewController: BaseViewController {
    var radio: RadioResponseModelRadio!{
        didSet{
            avPlayer.play()
        }
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    lazy var avPlayer: AVPlayer = {
        let avPlayer = AVPlayer(playerItem: AVPlayerItem(url: URL(string: radio.url)!))
        return avPlayer
    }()
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        super.touchesBegan(touches, with: event)
        //未登录进入
        if V2TIMManager.sharedInstance().getLoginStatus() == .STATUS_LOGOUT {
            present(LoginViewController(), animated: true, completion: nil)
            return
        }
    }

}
